

import tensorflow as tf

A = [[1, 1], [2, 2]]
A = tf.convert_to_tensor(A, dtype='float32')
B = [[1, 1], [2, 2]]
B = tf.convert_to_tensor(A, dtype='float32')

print(A.get_shape())


U = tf.Variable(tf.truncated_normal([2, 2, 2], stddev=0.1), dtype='float32')

shape = A.get_shape()
B = tf.reshape(B, (2, 1, int(shape[1])))
C = tf.reshape(A, (2, int(shape[1]), 1))
D = tf.matmul(C, B)
D = tf.reshape(D, (int(D.get_shape()[0]), int(D.get_shape()[1] * D.get_shape()[2])))



sess = tf.Session()

init = tf.global_variables_initializer()
sess.run(init)

print(sess.run(D))














